#pragma once 
#include <iostream>

using namespace std;

class Product
{
public:
    virtual void show() = 0;
};

class Product_A : public Product
{
public:
    virtual void show()
    {
        cout << "A" << endl;
    }
};

class Product_B : public Product
{
public:
    virtual void show()
    {
        cout << "B" << endl;
    }
};

class Factory
{
public:
    virtual Product* product() = 0;
};

class Factory_A : public Factory
{
public:
    virtual Product* product()
    {
        return new Product_A;
    }
};

class Factory_B : public Factory
{
public:
    virtual Product* product()
    {
        return new Product_B;
    }
};